<?php

namespace app\factory\controller;

use app\user\logic\DiseaseCategoryLogic;
use app\common\respond\HttpApi;

class DiseaseCategoryController
{
    /**
     * @Description 下拉选择
     * @author: zj
     * @param HttpApi $respond
     * @time 2024/03/28 15:58:15
     * @return \think\response\Json
     */
    public function selectList(HttpApi $respond)
    {
        $param = [
            'page' => (int)request()->get('page') ?: 1,
            'page_size' => (int)request()->get('page_size') ?: 10,
            'name' => request()->get('name')
        ];
        $rule = [
            'page' => 'require|integer|>:0',
            'page_size' => 'require|integer|>:0',
            'name' => 'integer|max:255',
        ];
        validate($rule)->check($param);

        $logic = new DiseaseCategoryLogic();
        $data = $logic->selectList($param);

        return $respond->success($data);
    }
}